***************************************************************************************
*************       Billionaire Politicians: A Global Perspective        **************
***************************************************************************************

*** Figure 1 ***
use "KNR_billionaire_politicians_officelevel.dta"
set scheme s1mono
collapse (sum) formal_office, by(name)
histogram formal_office, discrete percent ylabel(, angle(horizontal)) xtitle(Number of Offices)

* Run the following code before creating Figures 2-4
* Be sure to reopen the original office-level dataset to make Figures 2-4 (not the collapsed version from Figure 1)
label define region 0 "Rest of World" 1 "China"
label values china region

*** Figure 2 ***
use "KNR_billionaire_politicians_officelevel.dta"
set scheme s1mono
graph bar (sum) formal_office, over(china) over(path, descending) asyvars stack ytitle(Number of Offices) ylabel(, angle(horizontal) nogrid)

*** Figure 3 *** 
use "KNR_billionaire_politicians_officelevel.dta"
set scheme s1mono
graph bar (sum) formal_office, over(china) over(level) asyvars stack ytitle(Number of Offices) ylabel(, angle(horizontal) nogrid)

*** Figure 4 ***
use "KNR_billionaire_politicians_officelevel.dta"
set scheme s1mono
graph bar (sum) formal_office, over(china) over(branch, sort(branch_num)) asyvars stack ytitle(Number of Offices) ylabel(, angle(horizontal) nogrid)

*** Figure 5 ***
use "KNR_billionaire_politicians_countrylevel.dta"
set scheme s1mono
twoway qfitci formal_billionaire_ratio v2x_polyarchy if table_country==1, legend(off)||scatter   formal_billionaire_ratio v2x_polyarchy if table_country==1, mlabel(cname) msymbol(i) xlab(0(.2)1) ytitle(Proportion of Billionaire Politicians) ylab(0(.1).4) ylabel(, angle(0) nogrid) xtitle(Polyarchy Score) scheme(s2mono) graphregion(fcolor(white) ilcolor(white) lcolor(white))

*** Figure 6 ***
use "KNR_billionaire_politicians_partieslevel.dta"
set scheme s1mono
histogram leftrightdiff [fweight=weight], percent ylabel(, angle(horizontal)) xtitle (Billionaire Party-Median Party Difference)







